For a traditional storage system that supports in-place updating, when a file system writes new data, the old data at the same address will be covered, so that the performance of the storage system will not be affected; however, for a solid state storage device that cannot support in-place updating, there is a need for “move-erase” garbage collection to continuously provide space which is available for writing, if the file system does not inform the storage device of the address space corresponding to the invalid data, such data is also valid for the solid state storage device and accordingly will be continuously moved ineffectively during garbage collection, thereby degrading the performance of the solid state storage device. TRIM command commands a file system to inform a storage device of the address space corresponding to the invalid data. After receipt of such a command, the storage device will mark the invalid data to disenable the data to participate in the process of garbage collection so as to prevent the storage device from unnecessarily operating over the data, thereby improving the performance of the solid state storage device.
In the existing methods for implementing TRIM, TRIM information is only saved in a way of a bitmap, and when a file system writes new data into a range indicated by TRIM, the TRIM information needs to be updated in time and, in the meanwhile, part of the TRIM information is cached in the memory in order to accelerate the updating of the TRIM information. But, more storage space will be taken up if the TRIM information is only saved in a way of a bitmap. Accordingly, when a file system writes new data into a TRIM range, the TRIM information needs to be updated in time. As a result, TRIM will be tightly coupled with a normal data stream, the efficiency of the system will be reduced, the complexity of the system will be increased, and the caching of TRIM information increases the demand of the solid state storage system for memory.